#region Summary

// 
// Owner : JackieHan 
// 
// Solution : DailyCollection 
// 
// Project : Jackie.Utility.Notify
// 
// File : Service.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 服务主体
// 
// History : 
//			2011-04-25 14:53:50	    Create 
// 

#endregion

#region Using

using System;
using Common.Logging;
using Jackie.Utility.Notify.Domain;

#endregion

namespace Jackie.Utility.Notify.Service
{
    /// <summary> 
    /// 服务主体
    /// </summary>
    public class PublishService : IPublish
    {
        private ILog logger;

        public PublishService()
        {
            logger = LogManager.GetLogger(GetType());
        }

        public void SendMessage(MessageInfo info)
        {
            logger.Info("start send message:" + info.ToString());
            TitleMessageCollection.GetInstance().Add(info);
            logger.Info("end send message!");
        }

        public void RegisteredTitle(TitleInfo info)
        {
            logger.Info("start register message title:" + info.ToString());
            TitleCollection.GetInstance().Add(info);
            logger.Info("end register message title!");
        }

        public void CancelTitle(string titleCode)
        {
            logger.Info("start cancel message title! titleCode:" + titleCode);
            TitleCollection.GetInstance().Remove(titleCode);
            logger.Info("end cancel message title!");
        }
    }
}